import axios from 'axios'

//地图下钻
export const map=(data)=>{
    return axios({
        url:`https://geo.datav.aliyun.com/areas_v3/bound/${data}_full.json`
    })
}

// mock模拟
export const list=()=>{
    return axios ({
        url:'/list'
    })
}
// 登录
export const getlogin=(data)=>{
    return axios ({
        url:'/getlogin',
        method:'post',
        data
    })
}
// 获取所有用户信息
export const getulist=()=>{
    return axios ({
        url:'/getulist',
        method:'get'
    })
}
// 获取角色信息
export const getrole=()=>{
    return axios ({
        url:'/getrole',
        method:'get'
    })
}
// role添加渲染
export const roleadd=()=>{
    return axios ({
        url:'/roleadd',
        method:'get'
    })
}

// role add
export const getroleadd=(data)=>{
    return axios ({
        url:'/role/getadd',
        method:'post',
        data
    })
}

// role del
export const getroledel=(id)=>{
    return axios({
        url:'/role/getdel/'+id,
        method:'get'
    })
}

// role edit 渲染
export const getedit=(id)=>{
    return axios({
        url:'/getedit/'+id,
        method:'get'
    })
}

// role edit
export const getroleedit=(id,data)=>{
    return axios ({
        url:'/role/getedit/'+id,
        method:'post',
        data
    })
}

// auth get
export const getauth=()=>{
    return axios({
        url:'/getauth',
        method:'get'
    })
}

//auth add
export const getaadd=(data)=>{
    return axios({
        url:'/getauthadd',
        method:'post',
        data
    })
}


export const getadel=(id)=>{
    return axios({
        url:'/authdel/'+id
    })
}

export const getaedit=(id,data)=>{
    return axios({
        url:'/authedit/'+id,
        method:'post',
        data
    })
}